package com.cj.mainmodule.repo.observable

import io.reactivex.Observable
import io.reactivex.ObservableSource
import io.reactivex.ObservableTransformer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 *created by chen jun
 *on 2021/5/24 19:12
 */
class SchedulerTransformer<T>:ObservableTransformer<T,T> {
    override fun apply(upstream: Observable<T>): ObservableSource<T> {
        return upstream.subscribeOn(Schedulers.io())
                       .observeOn(AndroidSchedulers.mainThread())
    }
}